
/*
 *
 * All Rights Reserved.
 */
package com.model.demo.designmodel.proxy.dynamicproxy.dbroute;

import com.model.demo.designmodel.proxy.dbroute.Order;
import com.model.demo.designmodel.proxy.dbroute.OrderService;
import com.model.demo.designmodel.proxy.dbroute.OrderServiceImpl;

import java.util.Date;

/**
 * OrderServiceDynamicProxyTest 动态代理:数据源切换
 *
 * @author Liao Dongshan, 2019年06月04日
 *
 */
public class OrderServiceDynamicProxyTest {
    public static void main(String[] args) {
        OrderService orderService = (OrderService) new OrderServiceDynamicProxy().getInstance(new OrderServiceImpl());
        Order order = new Order();
        order.setCreateTime(new Date());
        orderService.saveOrder(order);
    }
}
